package com.kevis.common.exception;

import com.kevis.common.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//@RestControllerAdvice(basePackages ={"com.kevis.gulimall"})
//@RestControllerAdvice(basePackages = {"com.kevis.gulimall.coupon.controller"})
@Slf4j
public class GlobalGulimallException {

    @ExceptionHandler(value = Exception.class)
    public R AllException(Exception e){
        log.error("日志错误信息：",e);
        String msg = "运行异常：" + e.getMessage();
        return R.error(500,msg);
    }
}
